Skip to content

feat: Implement orgs endpoint for admin console#250

Merged
rodmgwgu merged 1 commit intoopenedx:mainfrom
WGU-Open-edX:rod/orgs-endpoint
Apr 9, 2026
Merged

feat: Implement orgs endpoint for admin console#250
rodmgwgu merged 1 commit intoopenedx:mainfrom
WGU-Open-edX:rod/orgs-endpoint

Conversation

@rodmgwgu
Copy link
Copy Markdown
Contributor

@rodmgwgu rodmgwgu commented Apr 7, 2026

Description

Closes: #228

Implement the /api/authz/v1/orgs/ endpoint to list and search orgs, with pagination, as required for filters in the Admin Console.

Deadline: Verawood

How to test

Using a local dev tutor installation, call the following endpoint with required credentials:

http://local.openedx.io:8000/api/authz/v1/orgs/

You should see a response similar to this:

{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 1,
            "created": "2026-04-02T19:30:36.779095Z",
            "modified": "2026-04-02T19:30:36.779095Z",
            "name": "OpenedX",
            "short_name": "OpenedX",
            "description": "",
            "logo": null,
            "active": true
        }
    ]
}

You can also test with params, for example:

http://local.openedx.io:8000/api/authz/v1/orgs?search=open&page_size=1&page=1

Other information

Co-authored by Amazon Q using Claude Sonnet 4.6.

Merge checklist:

Check off if complete or not applicable:

  • Version bumped
  • Changelog record added
  • Documentation updated (not only docstrings)
  • Fixup commits are squashed away
  • Unit tests added/updated
  • Manual testing instructions provided
  • Noted any: Concerns, dependencies, migration issues, deadlines, tickets

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Apr 7, 2026
@openedx-webhooks
Copy link
Copy Markdown

openedx-webhooks commented Apr 7, 2026

Thanks for the pull request, @rodmgwgu!

This repository is currently maintained by @openedx/committers-openedx-authz.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements the /api/authz/v1/orgs/ REST endpoint to support the Admin Console’s organization filter use case by providing searchable, paginated organization listings.

Changes:

  • Added OrgsAPIView (list + search filter) backed by DRF pagination.
  • Introduced OrganizationSerializer and wired the new endpoint into v1 URLs.
  • Added unit tests covering listing, searching, pagination, response shape, and auth requirements; bumped version and updated changelog.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
openedx_authz/rest_api/v1/views.py Adds OrgsAPIView using ListAPIView + SearchFilter + pagination.
openedx_authz/rest_api/v1/serializers.py Adds OrganizationSerializer used by the new endpoint.
openedx_authz/rest_api/v1/urls.py Registers the new orgs/ route.
openedx_authz/tests/rest_api/test_views.py Adds test coverage for org listing/search/pagination/auth.
openedx_authz/__init__.py Bumps library version to 1.3.0.
CHANGELOG.rst Adds a 1.3.0 release entry noting the new endpoint.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread openedx_authz/rest_api/v1/views.py
Comment thread openedx_authz/rest_api/v1/serializers.py Outdated
Comment thread openedx_authz/rest_api/v1/urls.py Outdated
Comment thread openedx_authz/rest_api/v1/views.py Outdated
Comment thread openedx_authz/rest_api/v1/serializers.py Outdated
Comment thread openedx_authz/rest_api/v1/views.py Outdated
status.HTTP_401_UNAUTHORIZED: "The user is not authenticated",
},
)
class OrgsAPIView(generics.ListAPIView):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That view has some extra methods and permissions checks that we don't want here

Copy link
Copy Markdown
Member

@mariajgrimaldi mariajgrimaldi Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: a better name for the view would make more sense to me if this is not the same API for listing orgs as the one from edx-organizations.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, thanks!

Copy link
Copy Markdown
Contributor

@wgu-taylor-payne wgu-taylor-payne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of items not covered by the other reviews.

Review assisted by Kiro

Comment thread openedx_authz/rest_api/v1/views.py
Comment thread openedx_authz/tests/rest_api/test_views.py
@mphilbrick211 mphilbrick211 added the mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). label Apr 8, 2026
@mphilbrick211 mphilbrick211 moved this from Needs Triage to In Eng Review in Contributions Apr 8, 2026
Copy link
Copy Markdown
Contributor

@dwong2708 dwong2708 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks.

Copy link
Copy Markdown
Member

@mariajgrimaldi mariajgrimaldi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit comment left to address. Thanks a lot!

@rodmgwgu rodmgwgu force-pushed the rod/orgs-endpoint branch from 21bfc30 to c106b49 Compare April 9, 2026 16:48
@rodmgwgu rodmgwgu force-pushed the rod/orgs-endpoint branch from 27f9892 to 21b2b0d Compare April 9, 2026 17:53
@rodmgwgu rodmgwgu merged commit 8fc8733 into openedx:main Apr 9, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from In Eng Review to Done in Contributions Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Task - RBAC AuthZ - Implement orgs endpoint for Admin Console

7 participants